
package rentalStore;

import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import javax.naming.NameAlreadyBoundException;
import rentalCompany.CarRentalCompanyRemote;

/**
 *
 * @author 
 */
public class ManagerSession implements ManagerSessionRemote {
    
   public void bindCarRentalCompany(String name, CarRentalCompanyRemote company) 
            throws RemoteException, NameAlreadyBoundException {
        CarRentalStore.addCarRentalCompany(name, company);
    }

    public void unbindCarRentalCompany(String name) throws RemoteException {
        CarRentalStore.removeCarRentalCompany(name);
    }

    public CarRentalCompanyRemote lookupCarRentalCompany(String name)
            throws RemoteException, NotBoundException {
        return CarRentalStore.getCarRentalCompany(name);
    }

    public int getReservationsForCarType(String name, String carType) throws RemoteException {
        return CarRentalStore.getRentals().get(name).getNumberOfReservationsForCarType(carType);
    }
    
}
